home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Playboy Club
/
Playboy Club.iso
/
instalar.mst
< prev
next >
Wrap
Text File
|
1997-10-13
|
13KB
|
362 lines
'**************************************************************************
'* Instalaτπo do PlayClub CD-ROM - CVFR
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST ASKLANG = 100
CONST ASKQUIT = 200
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST OPTIONS = 800
CONST APPHELP = 900
CONST ACTIVATEFONTS = 1300
CONST RESTARTWIN = 1500
CONST DESTPATH = 1700
CONST TOOBIG = 6300
CONST WS_VISIBLE=&H10000000
CONST WS_BORDER =&H00800000
CONST WS_CLIPCHILDREN =&H02000000
CONST GWL_STYLE =-16
CONST SW_SHOWMAXIMIZED=3
''Bitmap ID
CONST FUNDO = 1
GLOBAL szInf$
GLOBAL CUIDLL$ ''Define o nome da DLL a ser uasada.
GLOBAL CDROM$ ''Diret≤rio Default do CD-ROM.
GLOBAL DEST$ ''Diret≤rio Default de Destino.
GLOBAL OPTCUR$ ''Opτπo de Seleτπo das Dialog Boxes.
GLOBAL SRCDIR$ ''Mensagens de configuraτπo
GLOBAL ASYM$ ''Diret≤rio do ASYM.INI
GLOBAL WININI$ ''Diret≤rio do WIN.INI
GLOBAL SYSINI$ ''Diret≤rio do SYSTEM.INI
GLOBAL INI$
GLOBAL INI_TB50$
GLOBAL SPACOL&
GLOBAL SPACOS&
GLOBAL SaidaA$
GLOBAL SaidaB$
GLOBAL ErroFontes$
GLOBAL Lang%
DECLARE SUB Install
DECLARE SUB BackupInis (Extensao$)
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
DECLARE FUNCTION wincpufeatures LIB "Cpuinf16.dll" AS LONG
'**************************************************************************
'** Script Geral de Instalaτπo
'**************************************************************************
hWnd%=HwndFrame()
i1&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
j1%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
'*************************************************************************
INIT:
SPACOS& = 16000000
SPACOL& = 67000000
SPACO& = SPACOS&
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
OPTCUR$ = "I"
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SaidaA$ = "O Windows serß reiniciado e o CD-ROM estarß pronto para ser executado."
SaidaB$ = "O CD-ROM nπo estarß pronto atΘ que o Windows seja reiniciado."
ErroFontes$ = "As fontes da Instalaτπo foram corrompidas. Procure Suporte TΘcnico."
SetBitmap CUIDLL$, FUNDO
SetTitle "Playboy Club"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "PlayClub.INF"
END IF
ReadInfFile szInf$
SRCDIR$ = GetSymbolValue("STF_SRCDIR")
CDROM$ = MID$(SRCDIR$,1,3)
WININI$ = MakePath(GetWindowsDir(),"WIN.INI")
SYSINI$ = MakePath(GetWindowsDir(),"SYSTEM.INI")
INI$ = MakePath(GetWindowsDir(),"PlayClub.INI")
'*************************************************************************
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
DEST$ = WinDrive$
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Drive Invßlido ('"+WinDrive$+"').", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
'*************************************************************************
GETPATH:
DEST$ = "C:\PlayClub"
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
'*************************************************************************
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
DEST$ = "C:\PLAYCLUB"
END IF
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
'Testa o espaco disponivel no CD-ROM
IF GetFreeSpaceForDrive( MID$( DEST$, 1, 1 ) ) < SPACO& THEN
GOSUB DRIVEFULL
GOTO GETPATHL1
END IF
UIPop 1
''*************************************************************************
Install
''*************************************************************************
' ERR = 0
' sz$ = UIStartDlg(CUIDLL$, ACTIVATEFONTS, "FInstFontDlgProc", 0, "")
' UIPop 1
' GOTO QUIT
'*************************************************************************
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
''Opτπo de reinicializar o Windows
dlg% = RESTARTWIN
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
'*************************************************************************
QUITL1:
''Sai sem reiniciar o Windows
END
''''''''''''''''''''''''''''
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
ELSEIF sz$ = "RESTART" THEN
i% = DoMsgBox( SaidaA$, "Instalaτπo", MB_OK+MB_TASKMODAL+MB_ICONHAND)
ELSEIF sz$ = "EXIT" THEN
i% = DoMsgBox( SaidaB$, "Instalaτπo", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END IF
UIPop 1
END
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN ''Se o OK foi apertado...
GOTO QUITL1
END IF
'*************************************************************************
ERRQUIT:
i% = DoMsgBox(ErroFontes$, "Instalaτπo", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
'*************************************************************************
DRIVEFULL:
sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO DRIVEFULL
END IF
UIPop 1
RETURN
'*************************************************************************
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
'*************************************************************************
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'*************************************************************************
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
BackupInis("IBP")
DIR$ = DEST$
''Adiciona linhas de Animaτπo, Video Digital no Win.INI
CreateIniKeyValue WININI$,"MCI Extensions","avi","Avivideo", cmoAppend
''Adiciona linhas no System.INI
CreateIniKeyValue SYSINI$,"MCI", "Avivideo","mciavi.drv", cmoAppend
''Adiciona linhas no System.INI
CreateIniKeyValue SYSINI$,"MCI", "Animation1","mciaap.drv", cmoOverwrite
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
I% = DoesIniKeyExist (SYSINI$, "Drivers", "VIDC.RT21")
IF I% = 0 THEN
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
END IF
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
CreateIniKeyValue SYSINI$, "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
CreateIniKeyValue SYSINI$, "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
CreateIniKeyValue SYSINI$, "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
CreateIniKeyValue SYSINI$, "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
''Acerta origem e destino da instalacao no .INI
INI$ =MakePath(GetWindowsDir(),"PlayClub.INI")
CreateIniKeyValue INI$,"PATH","HD",DEST$, cmoOverwrite
CreateIniKeyValue INI$,"PATH","CD",SrcDir$+"PLAYCLUB\MIDIAS", cmoOverwrite
''localiza o .TBC para aplicacao ToolBook
INI_TB50$ = MakePath(GetWindowsDir(),"TB50.INI")
CreateIniKeyValue INI_TB50$,"CACHE FILES","PLAYCLUB.EXE",DEST$+"\PLAYCLUB.TBC", cmoOverwrite
'*************************************************************************
''Instala arquivos da seτπo VB4
AddSectionFilesToCopyList "VB4", SrcDir$+"VB\", Dest$
''Instala arquivos da seτπo SYSTEM
AddSectionFilesToCopyList "System", SrcDir$, MakePath(GetWindowsDir(),"SYSTEM")
''Instala arquivos da seτπo VFW
AddSectionFilesToCopyList "VFW", SrcDir$+"VFW\", MakePath(GetWindowsDir(),"SYSTEM")
''Instala arquivos da seτπo ToolBook
AddSectionFilesToCopyList "ToolBook", SrcDir$+"TBK\", Dest$
''Instala arquivos da seτπo EXE
AddSectionFilesToCopyList "EXE", SrcDir$+"EXESCR\", Dest$
''Instala arquivos da seτπo SCR
AddSectionFilesToCopyList "SCR", SrcDir$+"EXESCR\", MakePath(GetWindowsDir(),"SYSTEM")
'*************************************************************************
''Instala ou nao o modulo MMX e marca no .INI sua opcao
''i% = DoMsgBox( "Seu computador Θ MMX?", "Instalaτπo", 4+MB_TASKMODAL)
''if i% =6 then
j& = wincpufeatures()
if j& >= 8388608 then
''Instala arquivos da seτπo MMX
AddSectionFilesToCopyList "MMX", SrcDir$+"MMX\", Dest$
CreateIniKeyValue INI$,"MMX","IsMMX","1", cmoOverwrite
''Cria a seτπo de MMX vazia
CreateIniKeyValue INI$,"MMX","P_T","", cmoOverwrite
CreateIniKeyValue INI$,"MMX","P_B","", cmoOverwrite
CreateIniKeyValue INI$,"MMX","P_F","", cmoOverwrite
CreateIniKeyValue INI$,"MMX","P_A","", cmoOverwrite
CreateIniKeyValue INI$,"MMX","TIPO","", cmoOverwrite
CreateIniKeyValue INI$,"MMX","BACK","", cmoOverwrite
CreateIniKeyValue INI$,"MMX","FRONT","", cmoOverwrite
CreateIniKeyValue INI$,"MMX","AUDIO","", cmoOverwrite
'' Roda a instalacao do video for Windows 4.1
Run (SrcDir$+"VFW4\Ivi_95nt.exe")
else
'nao
CreateIniKeyValue INI$,"MMX","IsMMX","0", cmoOverwrite
end if
''Sempre inicia com 0
CreateIniKeyValue INI$,"PATH","PREVIEW","0", cmoOverwrite
'*************************************************************************
SetCopyGaugePosition 80, 110
CopyFilesInCopyList
'' Cria o grupo
CreateProgmanGroup "Playboy Club", "", cmoOverwrite
ShowProgmanGroup "Playboy Club", 1, cmoOverwrite
'' Cria os φcones Θ aqui
'' tem que copiar para o diretorio destino
CreateProgmanItem "Playboy Club", "Playboy Club", Dest$+"\Tb50Run.exe "+MakePath(SrcDir$+"PLAYCLUB\","PlayClub.exe") ,Dest$+"\playclub.ico", cmoOverwrite
Run ("regedit.exe /s "+MakePath(GetWindowsDir(),"system\regmci16.txt"))
''Run ("profdisp.exe")
i% = DoMsgBox( "A instalaτπo do CD-ROM Playboy Club foi efetuada com sucesso.", "Instalaτπo", 0+MB_TASKMODAL)
END SUB
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION
'*************************************************************************
SUB BackupInis(Extensao$) STATIC
WINBACK$ = MakePath(GetWindowsDir(),"WIN."+Extensao$)
SYSBACK$ = MakePath(GetWindowsDir(),"SYSTEM."+Extensao$)
IF EXISTS (WINBACK$) THEN
KILL WINBACK$
END IF
IF EXISTS (SYSBACK$) THEN
KILL SYSBACK$
END IF
OPEN WININI$ FOR INPUT AS 1
OPEN WINBACK$ FOR APPEND AS 2
WHILE EOF(1) = FALSE
LINE INPUT #1, LINHA$
PRINT #2,LINHA$
WEND
CLOSE 2
CLOSE 1
OPEN SYSINI$ FOR INPUT AS 1
OPEN SYSBACK$ FOR APPEND AS 2
WHILE EOF(1) = FALSE
LINE INPUT #1, LINHA$
PRINT #2,LINHA$
WEND
CLOSE 2
CLOSE 1
End Sub
'*************************************************************************